package com.hiedu.beans.dto;

import lombok.Data;

import javax.validation.constraints.Digits;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @ProjectName: hi-app
 * @Titile: ProductAddDTO
 * @Author: 86180
 * @Description: TODO
 */
@Data
public class ProductAddDTO {
    @NotBlank(message = "商品名称不能为空")
    private  String name;
    @NotNull(message =  "商品价格不能为空")
    @Digits(integer = 3,fraction = 2,message = "商品价格最多有3位整数，2位小数")
    private Float price;
    @NotNull(message =  "商品数量不能为空")
    @Min(value = 1,message = "商品数量不能小于1")
    private Integer num;
}
